﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Manufacturers.aspx.cs" Inherits="GetQuote.Web.Admin.Manufacturers" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v12.1, Version=12.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v12.1, Version=12.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("a.edit").live("click", function () {
                $("#title-popup-manu").text("Edit Manufacturer");
                $("#popupAddManufacturers").modal('show');
                return false;
            });
            $("#linkAdd").live("click",function () {
                $("#title-popup-manu").text("Add Manufacturer");
                $("#popupAddManufacturers").modal('show');
                return false;
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h3>Manufacturers</h3>
    <dx:ASPxGridView ID="gridManufacturer" runat="server" Width="100%" Theme="Office2010Silver" DataSourceID="ManufacturerDataSource">
        <Columns>
            <dx:GridViewDataColumn FieldName="Id" VisibleIndex="1" Settings-AllowSort="False" Settings-AllowAutoFilter="False" Width="90px" HeaderStyle-HorizontalAlign="Center">
                <HeaderTemplate>
                    <a href="#" id="linkAdd">Add New</a>
                </HeaderTemplate>
                <DataItemTemplate>
                    <a href="#" class="edit">Edit</a> | 
                    <a href="#" onclick="confirm('Do you really want to delete this Manufacturer?'); return false;">Delete</a>
                </DataItemTemplate>
            </dx:GridViewDataColumn>
            <dx:GridViewDataColumn FieldName="ImageUrl" VisibleIndex="2" Caption="Logo" Settings-AllowAutoFilter="False" Settings-AllowSort="False" Width="90px">
                <DataItemTemplate>
                    <img alt="Logo" src="<%# Eval("ImageUrl") %>" class="img-polaroid img-inside-grid" />
                </DataItemTemplate>
            </dx:GridViewDataColumn>
            <dx:GridViewDataColumn FieldName="Name" VisibleIndex="3" />
            <dx:GridViewDataColumn FieldName="Description" VisibleIndex="4" />
        </Columns>
        <SettingsBehavior ColumnResizeMode="NextColumn" />
        <Settings ShowFilterRow="True" />
    </dx:ASPxGridView>
    <asp:LinqDataSource ID="ManufacturerDataSource" runat="server"  onselecting="ManufacturerDataSource_Selecting"/>

    <div id="popupAddManufacturers" class="modal hide fade" tabindex="-1">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="title-popup-manu">Add Manufacturers</h3>
        </div>
        <div class="modal-body">
            <table class="full-width" cellspacing="2" cellpadding="2">
                <tr>
                    <td style="width:110px;">Name:</td>
                    <td><input type="text" style=" width:50%;" /></td>
                </tr>
                <tr>
                    <td>Logo:</td>
                    <td>
                        <img class="logo-manu-detail img-polaroid" alt="logo" src="../Images/Manufacturers/logo_kirsch.png" /><br />
                    
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td><input id="uplLogo" type="file" /></td>
                </tr>
                <tr>
                    <td style="vertical-align:top">Description:</td>
                    <td><textarea id="txtDescription" cols="20" rows="2" style=" width:98%; height:50px;"></textarea></td>
                </tr>
            </table>
        </div>
        <div class="modal-footer">
            <button class="btn btn-primary" data-dismiss="modal" >Save</button>
            <button class="btn" data-dismiss="modal">Close</button>
        </div>
    </div>
</asp:Content>
